﻿using Confluent.Kafka;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.IO;
using System.Security.Policy;
using System;
using System.Threading.Tasks;
using Qiniu.Util;
using Qiniu.Storage;
using Config = Qiniu.Storage.Config;
using Zone = Qiniu.Storage.Zone;
using Qiniu.Http;
using NuGet.Protocol.Core.Types;
using Microsoft.AspNetCore.Authorization;
using MYData.Core.BaseProvider;
using MYData.Entity.DomainModels;
using System.Reflection;

namespace MYData.WebApi.Controllers.System
{
    /// <summary>
    /// 部门控制器
    /// </summary>
    public partial class DepartController
    {
        [HttpGet, Route("DepartGetList")]
        public async Task<object> DepartGetList()
        {
            return Json(await _depart.DepartGetList());
        }
        /// <summary>
        /// 获取部门列表（递归）
        /// </summary>
        /// <returns></returns>
        [HttpGet, Route("DepartShow")]
        public async Task<IActionResult> DepartShow()
        {
            return Json(await _depart.DepartShow());
        }
        /// <summary>
        /// 部门查询（根据id）
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet, Route("DepartSearch")]
        public async Task<IActionResult> DepartSearch(string id)
        {
            return Json(await _depart.DepartSearch(id));
        }
        /// <summary>
        /// 根据部门Id获取 承建单位信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet, Route("GetResponsibleUnit")]
        public IActionResult GetResponsibleUnit(string id)
        {
            return Json(_depart.GetResponsibleUnit(id));
        }
    }
}
